using System;
using System.ComponentModel;
using System.Data.SqlClient;
using PropertyExpression.Common;

namespace PropertyExpression.ControllableQuery.Test2
{
    public static class SqlCommandExtensions
    {
        public static SqlParameter AddParameter(this SqlCommand it, string parameterName, object value)
        {
            return it.Parameters.AddWithValue(parameterName, value);
        }

        public static SqlParameter AddParameter(this SqlCommand it, string parameterName, string value)
        {
            return it.Parameters.Add(new SqlParameter(parameterName, value) {Size = -1});
        }
    }

    public static class TypeExtensions
    {
        public static Type<TResult> Type<T, TResult>(this Type<T> it, Func<T, TResult> func)
        {
            return new Type<TResult>();
        }        
    }
}